/*    This file is part of libmissive.
 *
 *    libmissive is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Lesser General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    libmissive is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public License
 *    along with libmissive.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MISV_CRYPT_H
#define MISV_CRYPT_H

#include <epistle/message.h>
#include <sodium.h>

typedef unsigned char Nonce[crypto_box_NONCEBYTES];

typedef unsigned char Box_pkey[crypto_box_PUBLICKEYBYTES];
typedef unsigned char Box_skey[crypto_box_SECRETKEYBYTES];

typedef unsigned char Sign_pkey[crypto_sign_PUBLICKEYBYTES];
typedef unsigned char Sign_skey[crypto_sign_SECRETKEYBYTES];

int
nonce_update(Nonce current, const Nonce newer);

void
box_keys(Box_skey skey, Box_pkey pkey);

void
sign_keys(Sign_skey skey, Sign_pkey pkey);

#endif
